#include <iostream>

#include "animal.h"
#include "cat.h"
#include "dog.h"
#include "interface.h"

using std::cout, std::endl;

void shout() {
  cout << endl << "##########  shout  ##########" << endl;

  Animal::Animal** animals = new Animal::Animal*[3];
  animals[0] = new Animal::Cat("Olivia");
  animals[1] = new Animal::Dog("JJJ");

  for (auto i = 0; i < 2; ++i) {
    cout << animals[i]->Shout() << endl;
    delete animals[i];
  }
  delete animals;

  cout << "##########  shout  ##########" << endl << endl;
}

void play() {
  cout << endl << "##########  play  ##########" << endl;

  Animal::IPlay** players = new Animal::IPlay*[3];
  players[0] = new Animal::Cat("Olivia");
  players[1] = new Animal::Dog("JJJ");

  for (auto i = 0; i < 2; ++i) {
    cout << players[i]->Play() << endl;
    delete players[i];
  }
  delete players;

  cout << "##########  play  ##########" << endl << endl;
}

int main() {
  shout();
  play();
  return 0;
}